#include "../TypeInfo.h"
#include "../TypeTraits.h"
#include <UnitTest++/UnitTest++.h>

using namespace MockItNow;

namespace
{
	TEST (StorageTypeIsNonConstValueType)
	{
		CHECK_EQUAL(true, (bool)IsValue<TypeInfo<int>::StorageType>::Value);
		CHECK_EQUAL(false, (bool)IsConst<TypeInfo<int>::StorageType>::Value);

		CHECK_EQUAL(true, (bool)IsValue<TypeInfo<const int>::StorageType>::Value);
		CHECK_EQUAL(false, (bool)IsConst<TypeInfo<const int>::StorageType>::Value);

		CHECK_EQUAL(true, (bool)IsValue<TypeInfo<int&>::StorageType>::Value);
		CHECK_EQUAL(false, (bool)IsConst<TypeInfo<int&>::StorageType>::Value);

		CHECK_EQUAL(true, (bool)IsValue<TypeInfo<const int&>::StorageType>::Value);
		CHECK_EQUAL(false, (bool)IsConst<TypeInfo<const int&>::StorageType>::Value);

		CHECK_EQUAL(true, (bool)IsPointer<TypeInfo<int*>::StorageType>::Value);
		CHECK_EQUAL(false, (bool)IsConst<TypeInfo<int*>::StorageType>::Value);

		CHECK_EQUAL(true, (bool)IsPointer<TypeInfo<const int*>::StorageType>::Value);
		CHECK_EQUAL(false, (bool)IsConst<TypeInfo<const int*>::StorageType>::Value);
	}

	TEST (StorageTypeIsCorrect)
	{
		CHECK_EQUAL(true, (bool)IsValue<TypeInfo<int>::StorageType>::Value);
		CHECK_EQUAL(false, (bool)IsConst<TypeInfo<int>::StorageType>::Value);

		CHECK_EQUAL(true, (bool)IsValue<TypeInfo<const int>::StorageType>::Value);
		CHECK_EQUAL(false, (bool)IsConst<TypeInfo<const int>::StorageType>::Value);

		CHECK_EQUAL(true, (bool)IsValue<TypeInfo<int&>::StorageType>::Value);
		CHECK_EQUAL(false, (bool)IsConst<TypeInfo<int&>::StorageType>::Value);

		CHECK_EQUAL(true, (bool)IsValue<TypeInfo<const int&>::StorageType>::Value);
		CHECK_EQUAL(false, (bool)IsConst<TypeInfo<const int&>::StorageType>::Value);

		CHECK_EQUAL(true, (bool)IsPointer<TypeInfo<int*>::StorageType>::Value);
		CHECK_EQUAL(false, (bool)IsConst<TypeInfo<int*>::StorageType>::Value);

		CHECK_EQUAL(true, (bool)IsPointer<TypeInfo<const int*>::StorageType>::Value);
		CHECK_EQUAL(false, (bool)IsConst<TypeInfo<const int*>::StorageType>::Value);
	}
}
